<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
	xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
<head th:replace="dashboard/header :: header"></head>
<body>

	<!--
@desc  更新
@author WeiXiaoJin
@since 2020-01-30 11:21:01
-->

	<div layout:fragment="content">
		<div class="container-fluid content-main">
			<div class="animated fadeIn">
				<div class="row">
					<div class="col-sm-12">
						<div class="card">
							<div class="card-body">

								<form class="form-horizontal" id="modifyForm">

									<input type="hidden" name="id" th:value="${bean.id}" />

									<div class="form-group row">
										<label class="col-md-2 col-form-label control-label"
											for="text-input">业务服务 </label>
										<div class="col-md-9">
											<input class="form-control" id="business" type="text"
												th:value="${ bean.business}" name="business"
												placeholder="业务服务">
										</div>
									</div>
									<!-- 
									<div class="form-group row">
										<label class="col-md-2 col-form-label control-label"
											for="text-input">银行代码 </label>
										<div class="col-md-9">
											<input class="form-control" id="bank" type="text"
												th:value="${ bean.bank}" name="bank" placeholder="银行代码">
										</div>
									</div>
									<div class="form-group row">
										<label class="col-md-2 col-form-label control-label"
											for="text-input">所属接口 </label>
										<div class="col-md-9">
											<input class="form-control" id="api" type="text"
												th:value="${ bean.api}" name="api" placeholder="所属接口">
										</div>
									</div>
									<div class="form-group row">
										<label class="col-md-2 col-form-label control-label"
											for="text-input">交易码 </label>
										<div class="col-md-9">
											<input class="form-control" id="transaction" type="text"
												th:value="${ bean.transaction}" name="transaction"
												placeholder="交易码">
										</div>
									</div>
									 -->
									<div class="form-group row">
										<label class="col-md-2 col-form-label control-label"
											for="text-input">服务描述 </label>
										<div class="col-md-9">
											<input class="form-control" id="serverDesc" type="text"
												th:value="${ bean.serverDesc}" name="serverDesc"
												placeholder="服务描述">
										</div>
									</div>
									<div class="form-group row">
										<label class="col-md-2 col-form-label control-label"
											for="text-input">接受IP </label>
										<div class="col-md-9">
											<input class="form-control" id="accessip" type="text"
												th:value="${ bean.accessIp}" name="accessIp"
												placeholder="接受IP">
										</div>
									</div>
									<div class="form-group row">
										<label class="col-md-2 col-form-label control-label"
											for="text-input">认证类型 </label>
										<div class="col-md-9">
											<input class="form-control" id="authType" type="text"
												th:value="${ bean.authType}" name="authType"
												placeholder="认证类型">
										</div>
									</div>
									<div class="form-group row">
										<label class="col-md-2 col-form-label control-label"
											for="text-input">客户端超时 </label>
										<div class="col-md-9">
											<input class="form-control" id="clientOuttime" type="text"
												th:value="${ bean.clientOuttime}" name="clientOuttime"
												placeholder="客户端超时">
										</div>
									</div>
									<div class="form-group row">
										<label class="col-md-2 col-form-label control-label"
											for="text-input">限制IP </label>
										<div class="col-md-9">
											<input class="form-control" id="denyip" type="text"
												th:value="${ bean.denyIp}" name="denyIp" placeholder="限制IP">
										</div>
									</div>
									<div class="form-group row">
										<label class="col-md-2 col-form-label control-label"
											for="text-input">加密方式 </label>
										<div class="col-md-9">
											<input class="form-control" id="encType" type="text"
												th:value="${ bean.encType}" name="encType"
												placeholder="加密方式">
										</div>
									</div>
									<div class="form-group row">
										<label class="col-md-2 col-form-label control-label"
											for="text-input">是否加密 </label>
										<div class="col-md-9">
											<input class="form-control" id="hasEncryption" type="text"
												th:value="${ bean.hasEncryption}" name="hasEncryption"
												placeholder="是否加密">
										</div>
									</div>
									<div class="form-group row">
										<label class="col-md-2 col-form-label control-label"
											for="text-input">是否熔断 </label>
										<div class="col-md-9">
											<input class="form-control" id="hasHystrix" type="text"
												th:value="${ bean.hasHystrix}" name="hasHystrix"
												placeholder="是否熔断">
										</div>
									</div>
									<div class="form-group row">
										<label class="col-md-2 col-form-label control-label"
											for="text-input">是否可访问 </label>
										<div class="col-md-9">
											<input class="form-control" id="hasOpen" type="text"
												th:value="${ bean.hasOpen}" name="hasOpen"
												placeholder="是否可访问">
										</div>
									</div>
									<div class="form-group row">
										<label class="col-md-2 col-form-label control-label"
											for="text-input">熔断器内容 </label>
										<div class="col-md-9">
											<input class="form-control" id="hystrixContent" type="text"
												th:value="${ bean.hystrixContent}" name="hystrixContent"
												placeholder="熔断器内容">
										</div>
									</div>
									<div class="form-group row">
										<label class="col-md-2 col-form-label control-label"
											for="text-input">限流 </label>
										<div class="col-md-9">
											<input class="form-control" id="limitRequest" type="text"
												th:value="${ bean.limitRequest}" name="limitRequest"
												placeholder="限流">
										</div>
									</div>
									<div class="form-group row">
										<label class="col-md-2 col-form-label control-label"
											for="text-input">服务IP </label>
										<div class="col-md-9">
											<input class="form-control" id="serverIp" type="text"
												th:value="${ bean.serverIp}" name="serverIp" placeholder="">
										</div>
									</div>
									<div class="form-group row">
										<label class="col-md-2 col-form-label control-label"
											for="text-input">服务端超时时间 </label>
										<div class="col-md-9">
											<input class="form-control" id="serverOuttime" type="text"
												th:value="${ bean.serverOuttime}" name="serverOuttime"
												placeholder="服务端超时时间">
										</div>
									</div>
									<div class="form-group row">
										<label class="col-md-2 col-form-label control-label"
											for="text-input">端口 </label>
										<div class="col-md-9">
											<input class="form-control" id="serverPort}" type="text"
												th:value="${ bean.serverPort}" name="serverPort}" placeholder="">
										</div>
									</div>
									<div class="form-group row">
										<label class="col-md-2 col-form-label control-label"
											for="text-input">禁止关闭时间 </label>
										<div class="col-md-9">
											<div class="input-group date">
												<span class="input-group-addon"><i
													class="fa fa-calendar"></i></span> <input type="text"
													class="form-control time-input" id="closeTime-3"
													name="closeTime"
													th:value="${ #dates.format(bean.closeTime, 'yyyy-MM-dd HH:mm:ss')}"
													data-type="datetime" data-format="yyyy-MM-dd HH:mm:ss"
													placeholder="yyyy-MM-dd HH:mm:ss" lay-key="closeTime-3">
											</div>
										</div>
									</div>
									<div class="form-group row">
										<label class="col-md-2 col-form-label control-label"
											for="text-input">解密代码 </label>
										<div class="col-md-9">
											<input class="form-control" id="decodeStr" type="text"
												th:value="${ bean.decodeStr}" name="decodeStr"
												placeholder="解密代码">
										</div>
									</div>
									<div class="form-group row">
										<label class="col-md-2 col-form-label control-label"
											for="text-input">全局头部 </label>
										<div class="col-md-9">
											<input class="form-control" id="globalHeader" type="text"
												th:value="${ bean.globalHeader}" name="globalHeader"
												placeholder="全局头部">
										</div>
									</div>
									<div class="form-group row">
										<label class="col-md-2 col-form-label control-label"
											for="text-input">开始访问时间 </label>
										<div class="col-md-9">
											<div class="input-group date">
												<span class="input-group-addon"><i
													class="fa fa-calendar"></i></span> <input type="text"
													class="form-control time-input" id="openTime-3"
													name="openTime"
													th:value="${ #dates.format(bean.openTime, 'yyyy-MM-dd HH:mm:ss')}"
													data-type="datetime" data-format="yyyy-MM-dd HH:mm:ss"
													placeholder="yyyy-MM-dd HH:mm:ss" lay-key="openTime-3">
											</div>
										</div>
									</div>
									<div class="form-group row">
										<label class="col-md-2 col-form-label control-label"
											for="text-input">重试次数 </label>
										<div class="col-md-9">
											<input class="form-control" id="retrics" type="text"
												th:value="${ bean.retrics}" name="retrics"
												placeholder="重试次数">
										</div>
									</div>
								</form>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>

	<footer th:replace="dashboard/footer :: footer"></footer>

	<script type="text/javascript">
		var modifyForm = $("#modifyForm");
		$(function() {
			addForm.validate({
				ignore : [],
				rules : {
					business : {
						required : true
					},
					bank : {
						required : true
					},
					api : {
						required : true
					},
					transaction : {
						required : true
					},
					serverDesc : {
						required : true
					},
					accessip : {
						required : true
					},
					authType : {
						required : true
					},
					clientOuttime : {
						required : true
					},
					denyip : {
						required : true
					},
					encType : {
						required : true
					},
					hasEncryption : {
						required : true
					},
					hasHystrix : {
						required : true
					},
					hasOpen : {
						required : true
					},
					hystrixContent : {
						required : true
					},
					limitRequest : {
						required : true
					},
					服务IP : {
						required : true
					},
					serverOuttime : {
						required : true
					},
					端口 : {
						required : true
					},
					closeTime : {
						required : true
					},
					decodeStr : {
						required : true
					},
					globalHeader : {
						required : true
					},
					openTime : {
						required : true
					},
					retrics : {
						required : true
					}
				}
			});
		});

		function submitHandler() {
			var result = $.validate.form("modifyForm");
			if (result) {
				var modifyUrl = ctx + "gateway/admin/gateBusinessServer/update";
				$.operate.save(modifyUrl, modifyForm.serialize());
			}
		}
	</script>
</body>
</html>
